package com.teichmann.engine;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;

import com.teichmann.bo.Car;
import com.teichmann.core.OnlinePage;

public class OnlineExecutor {

	private OnlinePage[] pages = new OnlinePage[] {
			new com.teichmann.core.targets.online.AutoCarro(),
			new com.teichmann.core.targets.online.SulRevendas() };
	private String parameter;

	public OnlineExecutor(String parameter) {
		this.parameter = parameter;
	}

	public List<Car> execute() throws Exception {
		try {
			CarSearch search = new CarSearch(pages);
			return search.process(parameter);
		} catch (IOException e) {
			throw e;
		}
	}

}
